<?php  if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
 * home
 *
 * @package default
 * @author
 **/
class Admins_model extends CI_Model {

	/**
	 * undocumented function
	 *
	 * @return void
	 * @author
	 **/
	function __construct()
	{
		parent::__construct();
	}
	public function get_data() {
		$query = $this->db->get ( 'admin' );
		return $query->result_array ();
	}

	function page($page=0, $per_page=20)
	{
		$result = $this->db->query("SELECT * FROM `{$this->db->dbprefix}admin` LIMIT $page, $per_page");
		return $result->result();
	}

	/**
	* @author changxm
	* 得到登录历史日志
	*/
	function getloginlog($page=0, $per_page=0){
		$sql = "SELECT * FROM {$this->db->dbprefix}adminloginlog
ORDER BY id DESC
LIMIT {$page},{$per_page}";
		$result = $this->db->query($sql);
		return $result->result();
	}

}
